package com.huawei.esdk.uc.sametime.util;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

import com.huawei.esdk.uc.jna.Constants;

public class GlobalConfiguration
{

    private static GlobalConfiguration instance;

    private boolean isSamtimeLogin = false;

    private boolean isUCLogin = false;
    
    private boolean isConf = false;

    private boolean isVideo = false;

    private boolean isUCInit = false;

    private Charset currentCharset = Charset.defaultCharset();

    // 当前登录的UC账号
    private Map<String, String> selfUCAccountInfo;

    // 呼出设备
    private int callDevice;

    private GlobalConfiguration()
    {
        callDevice = Constants.PhoneJointType.PC_Device;
        selfUCAccountInfo = new HashMap<String, String>();
    }

    public synchronized static GlobalConfiguration getInstance()
    {
        if (null == instance)
        {
            instance = new GlobalConfiguration();
        }
        return instance;
    }

    public void resetUCConfig()
    {
        this.isUCLogin = false;
        this.isConf = false;
        this.isVideo = false;
        this.selfUCAccountInfo.clear();
    }

    public void resetSametimeConfig()
    {
        this.isSamtimeLogin = false;
    }

    public void resetAllConfig()
    {
        this.resetUCConfig();
        this.resetSametimeConfig();
    }

    public boolean isUCLogin()
    {
        return isUCLogin;
    }

    public void setUCLogin(boolean isUCLogin)
    {
        this.isUCLogin = isUCLogin;
    }

    public boolean isSamtimeLogin()
    {
        return isSamtimeLogin;
    }

    public void setSamtimeLogin(boolean isSamtimeLogin)
    {
        this.isSamtimeLogin = isSamtimeLogin;
    }

    public boolean isConf()
    {
        return isConf;
    }

    public void setConf(boolean isConf)
    {
        this.isConf = isConf;
    }

    public boolean isVideo()
    {
        return isVideo;
    }

    public void setVideo(boolean isVideo)
    {
        this.isVideo = isVideo;
    }

    public int getCallDevice()
    {
        return callDevice;
    }

    public void setCallDevice(int callDevice)
    {
        this.callDevice = callDevice;
    }

    public Charset getCurrentCharset()
    {
        return currentCharset;
    }

    public boolean isUCInit()
    {
        return isUCInit;
    }

    public void setUCInit(boolean isUCInit)
    {
        this.isUCInit = isUCInit;
    }

    public Map<String, String> getSelfUCAccountInfo()
    {
        return selfUCAccountInfo;
    }

    public void setSelfUCAccountInfo(Map<String, String> selfUCAccountInfo)
    {
        this.selfUCAccountInfo = selfUCAccountInfo;
    }

}
